namespace EyeOpen.Web.Mvc
{
	using System.Web.Mvc;

	public class BaseController : Controller
	{
		protected virtual ActionResult Render(string viewName, object model = null)
		{
			if ((Request == null) || !Request.IsAjaxRequest())
			{
				return 
					model == null ? 
					              	this.View(viewName) : this.View(viewName, model);
			}

			return
				model == null ?
				              	PartialView(viewName) : PartialView(viewName, model);
		}
	}
}